<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.ArrayList"  %>
<%@ page import="java.util.Iterator"  %>
<%@ page import="net.jeanhwea.gold.bean.Item"  %>
<jsp:useBean id="dataManager" scope="application" class="net.jeanhwea.gold.model.DataManager"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ShowResult</title>
</head>
<body>
  <h1> Reusult </h1>
  <hr>
  <table border="1" style="table-layout:fixed" width="50%">
  <tr><td>ID</td><td>Price</td><td>Time</td><td>Date</td></tr>
<% 
  int id = Integer.parseInt(request.getParameter("id")); 
  ArrayList<Item> result = dataManager.getResultByID(id);
  Iterator<Item> iterator = result.iterator();
  while(iterator.hasNext()){
	  Item it = (Item)iterator.next();
%>
    <tr>
      <td><%= it.getID() %></td>
      <td><%= it.getPrice() %></td>
      <td><%= it.getTime() %></td>
      <td><%= it.getDate() %></td>
    </tr>
<%  
  }
%>
  </table>
<%
  if(result.size() == 0){
	  out.println("<p>No found</p>");
  }
%>
</body>
</html>